package com.sunmnet.j2ee.entity.powerdb.designer;

import com.sunmnet.j2ee.entity.base.BaseAutoEntity;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "pdm_field")
@DynamicInsert(true)
@DynamicUpdate(true)
public class Field extends BaseAutoEntity implements java.io.Serializable {

	private static final long serialVersionUID = 8689648138468045217L;

	private long createAccountId;
	private long modifyAccountId;
	private long moduleId;
	private long projectId;
	private String name;
	private String nameCn;
	private String remark;
	private Short type;
	private int length;
	private int decimalPoint;
	private short isNull;
	private short isPmKey;
	private long entityId;
	private short autoIncrement;
	private String script;
	private Long versionId;
	private Long domainId;
	private Short sortIndex;

	@Column(name = "version_id")
	public Long getVersionId() {
		return versionId;
	}

	public void setVersionId(Long versionId) {
		this.versionId = versionId;
	}

	@Column(name = "create_account_id")
	public long getCreateAccountId() {
		return createAccountId;
	}

	public void setCreateAccountId(long createAccountId) {
		this.createAccountId = createAccountId;
	}

	@Column(name = "modify_account_id")
	public long getModifyAccountId() {
		return modifyAccountId;
	}

	public void setModifyAccountId(long modifyAccountId) {
		this.modifyAccountId = modifyAccountId;
	}

	@Column(name = "module_id")
	public long getModuleId() {
		return moduleId;
	}

	public void setModuleId(long moduleId) {
		this.moduleId = moduleId;
	}

	@Column(name = "project_id")
	public long getProjectId() {
		return projectId;
	}

	public void setProjectId(long projectId) {
		this.projectId = projectId;
	}

	@Column(name = "name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "name_cn")
	public String getNameCn() {
		return nameCn;
	}

	public void setNameCn(String nameCn) {
		this.nameCn = nameCn;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "type")
	public Short getType() {
		return type;
	}

	public void setType(Short type) {
		this.type = type;
	}

	@Column(name = "length")
	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	@Column(name = "decimal_point")
	public int getDecimalPoint() {
		return decimalPoint;
	}

	public void setDecimalPoint(int decimalPoint) {
		this.decimalPoint = decimalPoint;
	}

	@Column(name = "is_null")
	public short getIsNull() {
		return isNull;
	}

	public void setIsNull(short isNull) {
		this.isNull = isNull;
	}

	@Column(name = "is_pmKey")
	public short getIsPmKey() {
		return isPmKey;
	}

	public void setIsPmKey(short isPmKey) {
		this.isPmKey = isPmKey;
	}

	@Column(name = "entity_id")
	public long getEntityId() {
		return entityId;
	}

	public void setEntityId(long entityId) {
		this.entityId = entityId;
	}

	@Column(name = "auto_increment")
	public short getAutoIncrement() {
		return autoIncrement;
	}

	public void setAutoIncrement(short autoIncrement) {
		this.autoIncrement = autoIncrement;
	}

	@Column(name = "script")
	public String getScript() {
		return script;
	}

	public void setScript(String script) {
		this.script = script;
	}

	@Override
	public String toString() {
		return new ReflectionToStringBuilder(
				this,
				ToStringStyle.DEFAULT_STYLE)
				.toString();
	}

	@Column(name = "domain_id")
	public Long getDomainId() {
		return domainId;
	}

	public void setDomainId(Long domainId) {
		this.domainId = domainId;
	}

	@Column(name = "sort_index")
	public Short getSortIndex() {
		return sortIndex;
	}

	public void setSortIndex(Short sortIndex) {
		this.sortIndex = sortIndex;
	}
}
